Functional Visitors Revisited

نویسندگان

  • Bryan Chadwick
  • Therapon Skotiniotis
  • Karl Lieberherr
چکیده

In object-oriented programming the visitor design pattern allows for the addition of new operations on a data hierarchy, but lends itself to scattered traversal code and makes visitors difficult to combine. Previous attempts to solve these issues have separated traversal code from the data structure but still face a lack of modularity in visitor computation making it difficult– if not impossible– to duplicate the flexibility of hand written, monolithic methods. In this paper we present a reformulation of the visitor pattern that introduces functional style traversals and visitor methods. Our modifications increase the context information available to visitor methods by way of the implicit stack of the recursive traversal, removing the need for side effects in visitor definitions. This gives visitors more flexibility during traversal, while their functional nature allows for modular, compositional solutions, leading to more reusable designs. To utilize these ideas we introduce a simple new functional visitor-oriented language, which allows us to build functional visitors without the syntax burdens of most object-oriented languages. To support visitor composition in our language we introduce five useful visitor combinators that can be used to develop self contained visitors and discuss motivating examples in our new language.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Characteristics of visitors and revisitors to an Internet-delivered computer-tailored lifestyle intervention implemented for use by the general public.

The Internet has become important for the delivery of behavior change interventions. This observational study examines how many people visited, registered and revisited a web-based computer-tailored intervention promoting heart-healthy behaviors when it is implemented for use by the general public. Among registered visitors, the association between visitors' characteristics and initiating, comp...

متن کامل

ACADEMIC WRITING REVISITED: A PHRASEOLOGICAL ANALYSIS OF APPLIED LINGUISTICS HIGH-STAKE GENRES FROM THE PERSPECTIVE OF LEXICAL BUNDLES

Lexical bundles are frequent word combinations that commonly appear in different registers. They have been the subject of much research in the area of corpus linguistics during the last decade. While most previous studies of bundles have mainly focused on variations in the use of these word combinations across different registers and a number of disciplines, not much research has been done to e...

متن کامل

The Role of Functional and Wellness Values in Visitors' Evaluation of Spa Experiences

By responding to the current emphasis on health and wellness in modern society, the spa industry has experienced a rapid growth in the last two decades. To understand the determinants of revisitation and long-term attitudinal loyalty, this study investigated how visitors perceive the potential value of spa experiences. The purpose of this study was to examine the role of two distinct dimensions...

متن کامل

Plant Pollinator Networks along a Gradient of Urbanisation

BACKGROUND Habitat loss is one of the principal causes of the current pollinator decline. With agricultural intensification, increasing urbanisation is among the main drivers of habitat loss. Consequently studies focusing on pollinator community structure along urbanisation gradients have increased in recent years. However, few studies have investigated how urbanisation affects plant-pollinator...

متن کامل

Optimization of recreational site selection using multi criteria evaluation and functional relationship diagram (Case study: Miankaleh wildlife sanctuary)

Today, ecotourism is a major tourist activity around the world. It is based on environment potential through which suitable utilization and conservation of sites under management practices including considering accurate planning, potential, and peoples’ preferences are realized. The present study was conducted to determine people’s recreational preferences using questionnaires to evaluate the e...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2006